import request from '/src/utils/request.js';
import { useTokenStore } from "@/stores/token.js";

//文章分类列表查询
export const articleCategoryListService = () => {
  const tokenStore = useTokenStore()
  return request.get("/article/list", {
    headers: {
      Authorization: tokenStore.token
    }
  });
};

//文章列表分页查询
export const articleListService = (params) => {
 return request.post("/article/page", params)
};

//文章添加
export const articleAddService = (articleData) => {
  return request.post("/article/add", articleData)
};

//文章修改
export const articleUpdateService = (articleData) => {
  return request.put("/article/update", articleData)
};
//批量删除文章
export const articleDeleteService = (id) => {
  return request.delete('/article/delete?id='+id);
};